import React, { useContext } from 'react'
import { Context } from '../store2'

export default function One() {
    const { state, dispatch } = useContext(Context)
    const { count } = state
    return (
        <div>
            <h4>
                我是One -- { count }
            </h4>
            <button onClick={() => {
                dispatch({ type: "ADD" })
            }}>++</button>
        </div>
    )
}
